home *** CD-ROM | disk | FTP | other *** search
/ Aminet 45 / Aminet 45 (2001)(GTI - Schatztruhe)[!][Oct 2001].iso / Aminet / dev / src / adasort.lha / Sort.ads < prev   
Text File  |  2001-08-28  |  682b  |  33 lines

  1. --
  2. --  Elementare Sortieralgorithmen in Ada
  3. --  Norman Walter, Universität Stuttgart
  4. --  Datum: 25.8.2001
  5. --
  6.  
  7. with text_io,ada.integer_text_io;
  8. use  text_io,ada.integer_text_io;
  9.  
  10. package Sort is
  11.  
  12.  subtype Index_Typ is Natural;
  13.  
  14.  type Element_Typ is new Integer;
  15.  -- Oder anderer Typ mit Ordnungsrelation
  16.  
  17.  type Feld_Typ is array(Index_Typ range <>) of Element_Typ;
  18.  
  19. Procedure Display (A: in Feld_Typ);
  20. -- Gibt komplettes Array aus
  21.  
  22. Procedure Swap (A,B: in out Element_Typ);
  23. -- Vertauscht zwei Elemente
  24.  
  25. Procedure Bubble_Sort (Sort_Array: in out Feld_Typ);
  26. -- Bubble Sort Algorithmus
  27.  
  28. Procedure Selection_Sort (Sort_Array: in out Feld_Typ);
  29. -- Selection Sort Algorithmus
  30.  
  31. end Sort;
  32.  
  33.